package net.comm.shequ.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.blog.bean.BaseBlog;
import net.comm.param.bean.BaseProperty;
import net.comm.shequ.bean.BaseShequ;
import net.comm.shequ.bean.BaseWyMember;
import net.comm.shequ.bean.BaseWyServe;
import net.comm.shequ.bean.BaseWyYanzh;
import net.comm.shequ.bean.BaseYewei;
import net.comm.shequ.bean.BaseYwMember;
import net.comm.util.StringUtil;

import org.apache.log4j.Logger;
import org.sakaiproject.db.api.SqlReader;

public class DbWyServeService implements SqlReader
{

	static Logger logger = Logger.getLogger(DbWyServeService.class.getName());

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{		
			int 	seqID 	= result.getInt(1);	//	序号
			int 	follID 	= result.getInt(2);	//	跟贴序号
			int  	wuyeID 	= result.getInt(3);	//	物业ID
			String  ntype 	= StringUtil.getValue(result.getString(4));	//	类型
			String 	title 	= StringUtil.getValue(result.getString(5));	//	标题
			String 	content 	= StringUtil.getValue(result.getString(6));	//	内容
			int  	f_ID 	= result.getInt(7);	//	附件ID
			String 	status 	= StringUtil.getValue(result.getString(8));	//	状态
			int  	attachcnt 	= result.getInt(9);	//	点击次数
			int  	replycnt 	= result.getInt(10);	//	回复次数
			int  	userID 	= result.getInt(11);	//	会员ID
			String 	IP 	= StringUtil.getValue(result.getString(12));		//	用户IP
			String 	mtime 	= StringUtil.getValue(result.getString(13));	//	最后修改时间

			// create the Resource from these fields
			return new BaseWyServe( seqID,  follID,  wuyeID,  ntype, title,  content,  f_ID,
					 status,  attachcnt,  replycnt,  userID, IP,  mtime );
		}
		catch (SQLException e)
		{
			logger.error("读取表数据持久层失败！");
			return null;
		}
		
	}
}
